errL = 1;
it = 0;

rho = L(2)/L(1);
clear errRed errRedT iter
n = 10;
X2 = rand(11560,1);
while(errL >= 1e-9)
        it = it + 1
    errLold=errL;
    X = X2;
    
    [X2 L2] = powermethodRHO(MR, X2, n);
    
    errL = norm(X2- sign(X2(1)/X_ref(1))*X_ref,2);
    
    [errL/errLold (1/rho^n)];
    iter(it) = n*it;
    errRed(it) = errL/errLold;
    errRedT(it)= rho^(n);

end

semilogy(iter,errRed,'k',iter,errRedT,'b--','LineWidth',2)
grid on
xlabel('iteration')
ylabel('||x_{ref}-x||_2')
axis([0 max(iter) min(errRed)/1.2 max(errRedT)*1.2])